package com.zbkj.service.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zbkj.common.model.client.workbench.IntoPieces;
import com.zbkj.common.model.client.workbench.VideoTemplateFinal;
import com.zbkj.service.dao.client.IntoPiecesDao;
import com.zbkj.service.dao.client.VideoTemplateFinalDao;
import com.zbkj.service.service.IntoPiecesService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 成片表 服务实现类
 */
@Slf4j
@Service
public class IntoPiecesServiceImpl extends ServiceImpl<IntoPiecesDao, IntoPieces> implements IntoPiecesService {

    @Autowired
    private IntoPiecesDao intoPiecesDao;

    /**
     * 获取
     * @param userId
     * @return
     */
    @Override
    public Integer countPieceByUserId(Integer userId) {
        QueryWrapper<IntoPieces> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("is_del", 0)
                .eq("user_id", userId)
                .eq("is_folder", 0);
        return intoPiecesDao.selectCount(queryWrapper);
    }
}